package leetcode;

public class Decorator{
	public static void main(String[] args){
		Person xiaomingPerson = new Person();
		Trousers trousers = new Trousers(xiaomingPerson);
		Tshirt tshirt = new Tshirt(trousers);
		
		tshirt.show();
		
	}
}

class Person {
	protected String name;
	protected String body;
	public void show(){
		System.out.println("身体");
	}
	
}

class Trousers extends Person{
	private Person person;
	public Trousers(Person person){
		this.person = person;
	}
	@Override
	public void show(){
		System.out.println("大裤衩");
		person.show();
	}
}

class Tshirt extends Person {
	private Person person;
	public Tshirt(Person person) {
		this.person = person;
	}
	@Override
	public void show(){
		System.out.println("衣服");
		person.show();
	}
}


